<%@ page import="database.TakeCourseDb" %>
<%@ page import="utils.StringUtils" %><%--
  Created by IntelliJ IDEA.
  User: Thinkpad
  Date: 2016/12/11
  Time: 15:00
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>删除选课</title>
</head>
<body>
<%
    if (StringUtils.isEmpty(request.getParameter("studentId")) || StringUtils.isEmpty(request.getParameter("courseId"))) {
        response.getWriter().print("<script>location.href='../../error.jsp?error_code=103'</script>");
    } else {
        String studentId = request.getParameter("studentId");
        int courseId = Integer.parseInt(request.getParameter("courseId"));
        TakeCourseDb.removeStudentFromCourse(studentId, courseId);
        response.getWriter().print("<script>location.href='../selectCourse_Table.jsp?courseId='" + courseId + "</script>");
    }
%>
</body>
</html>
